<?php defined('SYSPATH') or die('No direct script access.');

class Controller_404 extends Controller {
	
	public function before(){
		parent::before();
	}
	
	public function after(){		
		if ($this->request->is_ajax()){
			$ajax = new lib_ajax();
			$ajax->fail('HTTP/1.0 404 Not Found')->json()->exec();
		}else{
			echo View::factory('404/404')
		    ->set('exception',$this->post)
		    ->set('referer',Session::instance()->get('ref'));
		}
		
		parent::after();
	}
	
	public function action_index()
	{
		$this->post = $this->request->post();
	}

} // End Welcome
